package com.weigee.ktv.model.entities

/**
 * Created by linde on 2017/5/31.
 *<p/>
 * 购物车列表实体类,通过 ShoppingCartListAdapter 列出已加入购物车的商品
 */
class ShoppingCartListEntity(val shopId: Int?, val goodsEntity: ShoppingGoodsEntity?) {
    var shoppingGoodsCheckNum: Int
        private set

    init {
        shoppingGoodsCheckNum = 1
    }

    fun addCheck() {
        if (shoppingGoodsCheckNum <= 0) shoppingGoodsCheckNum = 1 else shoppingGoodsCheckNum++
    }

    fun subChecked() {
        if (shoppingGoodsCheckNum <= 1) shoppingGoodsCheckNum = 0 else shoppingGoodsCheckNum--
    }
}